home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
TSPA3460
/
TSUNTH.INT
< prev
next >
Wrap
Text File
|
1994-08-16
|
6KB
|
160 lines
{$B-,D-,F-,I+,N-,R-,S+,V+}
(*
Timo Salmi UNiT H
A Turbo Pascal unit of system information and more miscellania
All rights reserved 24-Feb-90
Updated 15-Apr-90, 23-Jul-90, 1-Aug-90, 8-Aug-90, 5-Jan-90, 22-Jul-91
24-Nov-91, 23-Aug-92, 4-Feb-93, 13-Jun-93
In the 24-Nov-91 update part of the old routines has been transferred to
TSUTNTJ because this TSUNTH unit started to grow too much. The transferred
routines were
COPYFILE Copy a file from within a Turbo Pascal program
ISDIRFN Is a name a directory or not
OPENEDFN Is an assigned textfile still open or not
PIPEDIFN Is the standard input from redirection
PIPEDNFN Is the standard output redirected to nul
PIPEDOFN Is the standard output redirected
In the 23-Aug-92 update one of the old routines has been transferred to
a new TSUNTK which harbors the MsDos 4.+ specific routines.
BOOTDRFN Get boot device name (MsDos 4.+)
In the 4-Feb-93 update replaced CHIPFN processor detection routine
by the CPUFN function.
This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
NON-INSTITUTIONAL purposes, provided it is not changed in any way, and
that a proper attribution is made. For ANY other usage, such as use in a
business enterprise or at a university, contact the author for the terms
of registration.
The units are under development. Comments and contacts are solicited. If
you have any questions, please do not hesitate to use electronic mail for
communication.
InterNet address: ts@uwasa.fi
The author shall not be liable to the user for any direct, indirect or
consequential loss arising from the use of, or inability to use, any unit,
program or file howsoever caused. No warranty is given that the units and
programs will work under all circumstances.
Timo Salmi
Professor of Accounting and Business Finance
Faculty of Accounting & Industrial Management; University of Vaasa
P.O. BOX 297, FIN-65101 Vaasa, Finland
*)
unit TSUNTH;
(* ======================================================================= *)
interface
(* ======================================================================= *)
uses Dos
{$IFDEF VER40}
,TSUNT45
{$ENDIF}
;
(* ====================================================================
Software information
==================================================================== *)
(* Graftabl MsDos command loads the extended character set to be used in
the graphics mode. This function tells whether the table has been
already loaded, or not *)
function GRTABLFN : boolean;
(* Returns the country code if MsDos 3+. For an error and earlier MsDos
versions returns zero. See MsDos manual "How to use Code Pages" for
the country codes *)
function COUNTRFN : word;
(* Return the country-dependent date format, reguires 3.0+,
Principal return formats: MM-DD-YY ('-' or whatever is the
DD-MM-YY relevant separator)
YY-MM-DD
On error or MsDos < 3.0 returns ('XX*XX*XX');
Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
function DATEFMFN : string;
(* Return the country-dependent time format, reguires 3.0+,
Principal return formats: 12-hour HH:MM:SS (':' or whatever is the
24-hour HH:MM:SS relevant separator)
On error or MsDos < 3.0 returns ('00h');
Norton & Wilton ss. 358-360, 412, Duncan 395-398, Dettmann 586 *)
function TIMEFMFN : string;
(* ====================================================================
Hardware information
==================================================================== *)
(* Returns the type of the processor chip
0 = 8086/88
2 = 80286
3 = 80386
4 = 80486
The function is based on the assembler code from Dettmann & Johnson,
Dos Programmers Reference, 3rd Edition, Que, 1992
The inline conversion by Duncan Murdoch is acknowledged with my
best thanks *)
function CPUFN : byte;
(* Is a math coprocessor present. And, yes, yes, I know that there is a
Test8087 variable in Turbo Pascal, but I have found it unreliable *)
function MATHCOFN : boolean;
(* Number of serial ports *)
function RS232FN : byte;
(* Number of parallel ports (printers installed) *)
function PARPORFN : byte;
(* Is mouse hardware and driver present, a simple true / false test *)
function ISMOUSFN : boolean;
(* Status of the mouse hardware and driver
0 : no mouse
1 : mouse with other than two buttons
2 : mouse with two buttons
3 : Mouse Systems or Logitech mouse
4 : Unknown or unresolved mouse status *)
function MOUSTAFN : byte;
(* Get the version (date) of the ROM BIOS. It is of the format mm/dd/yy.
Returns 'NotKnown' if unavailable *)
function ROMDTEFN : string;
(* Is the keyboard an enhanced keyboard *)
function ISENHAFN : boolean;
(* Last drive of the system, softcoded, not for XTs *)
function LASTDRFN : char;
(* This function gives the interleave factor of a given drive.
If you give a non-existent drive name, interlfn return zero.
This is for fixed disks. Applying on a floppy drive will give
nonsensical values, not for XTs. I am not convinced that this
works with all the different conrollers around *)
function INTERLFN (drive : char) : byte;
(* Number of FATs, not for XTs *)
function FATSFN (drive : char) : byte;
(* Number of cylinders on a device, requires MsDos 3.2+.
In case of modia not present, error, or wrong MsDos version,
returns 0 *)
function NRCYLFN (drive : char) : byte;
(* ====================================================================
Perform tasks
==================================================================== *)
(* Convert an Asciiz (#0 limited) string into an ordinary ascii string.
Some of the routines in this unit internally need Z2ASCFN, but why
not make it also generally available as well *)
function Z2ASCFN (asciiz : string) : string;